<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 第一步:引包 -->
    <script src="./echarts.js"></script>
    <style>
        .box {
            width: 800px;
            height: 400px;
            margin: 30px auto;
            border: 1px solid black;
        }
    </style>
</head>

<body>
    <!-- 容器:wh -->
    <div class="box"></div>
</body>

</html>
<script>
    //第一步:初始化echarts实例
    let mycharts = echarts.init(document.querySelector('.box'));
    //第二步:配置项
    let option = {
        title: {
            text: '饼图',
            subtext: '学习'
        },
        xAxis: {
            type: 'category'
        },
        yAxis: {
            show: false,//隐藏Y轴
        },
        series: [
            { type: 'bar', data: [10, 20, 30, 40, 50] },
            {
                type: 'pie',
                data: [{name:'裤子',value:100},{name:'鞋子',value:37},{name:'汉服',value:99}],
                width:300,
                height:300,
                radius:80,
                left:100,//left|top|right|bottom|调整位置
                label:{
                    color:'red'
                }
            }

        ]
    };

    //第三步：设置配置项
    mycharts.setOption(option);

</script>